<!DOCTYPE html>
[#escape x as (x)!?html]
<html lang="zh-CN">
  <head>
    <meta charset="utf-8" />
    <title>${vote.title} - ${site.seoTitle} - Powered by JPROCMS</title>
    <meta name="keywords" content="${site.seoKey}" />
    <meta name="description" content="${site.seoDesc}" />
    [#include '../includes/common_res.html'/]
  </head>
  <body>
    [#assign shadowNav=true/] [#include '../includes/header.html'/]
    <div class="bg-gray-200">
      <div class="container">
        <nav class="row" aria-label="breadcrumb">
          <ol class="col list-inline my-2">
            <li class="list-inline-item"><a href="${site.url}">首页</a></li>
            <li class="list-inline-item">/</li>
            <li class="list-inline-item"><a href="${base}/vote">投票</a></li>
          </ol>
        </nav>
      </div>
    </div>
    <div class="container mt-4">
      <h3>${vote.title}</h3>
      <div class="mt-2 pb-2 border-bottom text-muted">
        <div>
          <span>${ZFormat(vote.createTime, 'yyyy-MM-dd HH:mm')}</span>
          [#if vote.status == 0]
          <span class="ml-2 badge badge-success">进行中</span>
          [#elseif vote.status == 1]
          <span class="ml-2 badge badge-secondary">未启用</span>
          [#elseif vote.status == 2]
          <span class="ml-2 badge badge-warning">未开始</span>
          [#elseif vote.status == 3]
          <span class="ml-2 badge badge-info">已结束</span>
          [#else]
          <span class="ml-2 badge badge-danger">未知状态</span>
          [/#if]
          <i class="ml-2 fas fa-vote-yea text-primary" title="参与人次"></i>
          <span>${vote.voteNum}</span>
        </div>
        [#if vote.description??]
        <div class="mt-2 small">${vote.description}</div>
        [/#if]
      </div>
      <div class="mt-3 small text-muted check-group">
        [#list vote.items as item]
        <div class="mt-2 d-flex align-items-center">
          <div class="flex-grow-1">
            <span>${(item_index+1)?upper_abc}.</span
            ><span class="ml-2">${item.title}</span>
          </div>
          <div class="text-right mr-4">${item.count} 票</div>
          <div class="progress" style="width: 200px">
            <div
              class="progress-bar bg-warning"
              role="progressbar"
              style="width: ${item.percent?round}%"
              aria-valuenow="${item.percent}"
              aria-valuemin="0"
              aria-valuemax="100"
            ></div>
          </div>
          <div class="text-right" style="width: 60px">
            ${item.percent?string('0.0')}%
          </div>
        </div>
        [/#list]
      </div>
      <input type="hidden" name="id" value="${vote.id?c}" />
      <div class="mt-4 text-center">
        <a
          href="${base}/vote/${vote.id?c}"
          class="ml-2 btn btn-outline-danger btn-sm"
          >投票</a
        >
      </div>
    </div>
    [#include '../includes/footer.html'/] [#include '../includes/inc_msg.html'/]
  </body>
</html>
[/#escape]
